import { configureStore } from '@reduxjs/toolkit';
import counterReducer from './slices/counterSlice';
import appReducer from './slices/appSlice';
import themeReducer from './slices/themeSlice';
import danmuReducer from './slices/danmuSlice';
import { useDispatch } from 'react-redux';

const store = configureStore({
  reducer: {
    counter: counterReducer,
    app: appReducer,
    theme: themeReducer,
    danmu: danmuReducer,
  },
});

export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
export const useAppDispatch = () => useDispatch<AppDispatch>();
export default store;
 